#ifndef RIVIAFILEIMPORTERMGR_H
#define RIVIAFILEIMPORTERMGR_H

#include <QMap>
#include <QString>

class RIVIAFileImporterBase;

class RIVIAFileImporterMgr
{
public:
    static RIVIAFileImporterMgr* getInstance();

public:
    void addImporter(const QString& strFileType, RIVIAFileImporterBase* pImporter);
    RIVIAFileImporterBase* getImporter(const QString& strFileType);
private:
    RIVIAFileImporterMgr();
    ~RIVIAFileImporterMgr();

private:
    QMap<QString, RIVIAFileImporterBase*> m_oImportermap;
};

#define RIVIA_REGISTER_IMPORTER(importer, FileType)  \
class importer##Factory                                      \
{                                                                                                     \
public:                                                                                               \
    importer##Factory(){RIVIAFileImporterMgr::getInstance()->addImporter(#FileType, new importer());}     \
}; \
static importer##Factory g_##importer##strategyInstance;

#endif // RIVIAFILEIMPORTERMGR_H
